import request from '@/utils/request.js'

// 分页获取所有文章接口
export const articleListService = (params) => {
    return request.get('/article', { params: params });
}

// 封装添加文章接口
export const articleAddService = (articleModel) => {
    return request.post('/article/add', articleModel);
}

// 封装修改文章接口
export const articleUpdateService = (articleModel) => {
    return request.post('/article/update', articleModel);
}

// 封装删除文章接口
export const articleDeleteService = (id) => {
    return request.delete('/article?id=' + id);
}

// 统计热度前十文章信息
export const articleHeatService = () => {
    return request.get('/article/getHeatArticles');
}

// 统计文章数量
export const articleCountService = () => {
    return request.get('/article/count');
}
